class AddMissingIndexes < ActiveRecord::Migration[5.2]
  def change
    add_index :addresses, :city_id
    add_index :addresses, :district_id
    add_index :addresses, :province_id
    add_index :addresses, :user_id
    add_index :brands, :shop_category_id
    add_index :comments, :order_item_id
    add_index :comments, :spu_id
    add_index :comments, :user_id
    add_index :favorites, :user_id
    add_index :favorites, [:favoriteable_id, :favoriteable_type]
    add_index :option_types, :shop_category_id
    add_index :option_values, :option_type_id
    add_index :order_items, :order_id
    add_index :order_items, :sku_id
    add_index :order_items, :spu_id
    add_index :order_items, :user_id
    add_index :orders, :shop_id
    add_index :orders, :user_id
    add_index :shop_category_brands, :brand_id
    add_index :shop_category_brands, :shop_category_id
    add_index :shop_notifications, :shop_id
    add_index :shopers, :shop_id
    add_index :shops, :city_id
    add_index :shops, :district_id
    add_index :shops, :province_id
    add_index :sku_images, :sku_id
    add_index :sku_option_values, :option_type_id
    add_index :sku_option_values, :option_value_id
    add_index :sku_option_values, :sku_id
    add_index :skus, :spu_id
    add_index :spu_details, :spu_id
    add_index :spu_images, :spu_id
    add_index :spu_parameters, :spu_id
    add_index :spu_service_items, :service_item_id
    add_index :spu_service_items, :spu_id
    add_index :spus, :brand_id
    add_index :spus, :shop_category_id
    add_index :spus, :shop_id
  end
end
